<?php include load_template('_subnav.php') ?>
<h1><?php if($cat) {echo "Editing";} else { echo "Adding New";} ?> Category</h1>

<?php echo  error_messages_for('category') ?>

<div class='section'>

<?php echo  form_tag('modify_category',array('validation'=>true)) ?>
<?php echo  hidden_field('category','id') ?>

<label for='category_name'><span style='color:red'>*</span> Name</label>
<?php echo  text_field('category','name',array('alt'=>'blank','emsg'=>'Name can not be blank','size'=>'40')) ?>

<label for='category_description'>Description (optional)</label>
<?php echo  text_area('category','description',array('size'=>'40x5')) ?>

<label for='category_parent_id'>Category Parent</label>
<?php $none = "<option value='0'>None</option>" ?>
<?php echo  select_tag('category[parent_id]',
                $none.options_for_select($all_categories,$category->get('parent_id')),
                array('id'=>'category_parent_id')) ?>

<br /><br /><?php echo  submit_tag('Submit') ?> <?php echo  link_to('Cancel',array('controller'=>'admin/news' ,'action'=>'categories')
) ?>

<?php echo  end_form_tag() ?>
</div>